package bio;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Scanner;

public class BioClient {
    public static void main(String[] args) {
        try (Socket socket = new Socket("localhost",8888)) {
            Scanner scanner = new Scanner(socket.getInputStream());
            byte[] buf = new byte[1024];
            while (true) {
                System.in.read(buf);
                socket.getOutputStream().write(buf);
                socket.getOutputStream().write("\n".getBytes());
                String line = scanner.nextLine();
                System.out.println(line);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


}
